<template>
	<!-- 视频预览 -->
	<uv-popup :overlayStyle="{ background: 'rgba(0, 0, 0, 1)' }" ref="videoPopup" :safeAreaInsetBottom="false" bgColor="#000000" @maskClick="maskClick">
		<video v-if="currVideo" class="video-pre" :src="currVideo"></video>
	</uv-popup>
</template>

<script setup>
import { computed, watch, onMounted, getCurrentInstance, ref, defineEmits } from 'vue';
const { proxy: that } = getCurrentInstance();
let props = defineProps({
	show: {
		type: Boolean,
		default: () => {
			return false;
		}
	},
	currVideo: {
		type: String,
		default: () => {
			return '';
		}
	}
});
const emit = defineEmits(['close']);

function maskClick() {
	emit('close', false);
}

let columns = ref([]);
onMounted(() => {});
watch(
	() => props.show,
	(newValue, oldValue) => {
		console.log(newValue, oldValue, '值变化');
		if (props.show) {
			that.$refs.videoPopup.open('center');
		} else {
			that.$refs.videoPopup.close();
		}
	}
);
// const statusText = computed(() => {

// });
</script>

<style scoped lang="scss">
	.video-pre{
		width: 750rpx;
		height: 60vh;
	}
</style>
